<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title>phr-app</title>
  </head>
  <body>
    <noscript>
      <strong>We're sorry but phr-app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
    <!--用于打包之后，手机返回键的问题-->
    <script>
        document.addEventListener('plusready', function() {
            var lastClickTime = 0;
            var webview = plus.webview.currentWebview();
            plus.key.addEventListener('backbutton', function() {
                webview.canBack(function(e) {
                    //点击两次返回到桌面
                    var current = new Date().getTime();
                    if(current - lastClickTime < 500){
                        plus.runtime.quit()
                    }
                    else if(e.canBack) {
                        webview.back();
                    }
                    lastClickTime = current
                })
            });
        });
    </script>
  </body>
</html>
